import java.util.Scanner;
public class Test {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("机票原价：");
        double price=sc.nextDouble();
        System.out.println("请输入月份：");
        int month=sc.nextInt();
        System.out.println("请输入仓类型：");
        String type=sc.next();
        double rs=calc(price,month,type);
        System.out.println("您当前购买的价格是"+rs+"元");
    }
    public static double calc(double money,int month,String type){
        if(month>=5&&month<=10){
            switch(type){
                case "经济舱":
                    money*=0.85;
                    break;
                case "头等舱":
                    money*=0.9;
                    break;
                default:
                    System.out.println("您输入有误");
                    money=-1;// 当前计算不正确
            }
            
        } else if (month==11||month==12||month>=1&&month<=4) {
            switch(type){
                case "经济舱":
                    money*=0.65;
                    break;
                case "头等舱":
                    money*=0.7;
                    break;
                default:
                    System.out.println("您输入有误");
                    money=-1;// 当前计算不正确
            }
        }else{
            System.out.println("月份有问题");
            money=-1;
        }
        return money;
    }
}
